import { ObjCreate } from "../common/ObjCreate";
import { GlobalStyle } from "../../../common/global/GlobalStyle";
import { ImagesConst } from "../../resource/ImagesConst";
import { LoaderHelp } from "../../../common/display/LoaderHelp";
import { ResFileConst } from "../../resource/ResFileConst";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
type int = number;
//class LuckyBagBackSp
    
    export  class LuckyBagBackSp /* flash.display.Sprite */
    {
        constructor(arg1: int)
        {
            
            this.useHandCursor = true;
            this.buttonMode = true;
            this.initview();
            this.setData(arg1);
            return;
        }

        /* internal  */setData(arg1: int): void
        {
            if (arg1 <= 0) 
            {
                this.showCost(false);
            }
            else 
            {
                this.showCost(true);
                this._costTx.text = arg1.toString();
            }
            return;
        }

        /* internal  */initview(): void
        {
            this._bg = ObjCreate.createBitmap("", 0, 0, this);
            this._itembg = ObjCreate.createBitmap("", 26, 65, this);
            this._costTx = ObjCreate.createGTextField("", 42, 66, 50, 20, this, GlobalStyle.textFormat6);
            this._costTx.rotationY = -1;
            addChild(this._costTx);
            this._goldBg1 = ObjCreate.createBitmap(ImagesConst.Yuanbao_small, 67, 67, this);
            this.showCost(false);
            LoaderHelp.addResCallBack(ResFileConst.LuckyBag, this.onLoadBmResource);
            return;
        }

        /* internal  */onLoadBmResource(): void
        {
            this._bg.bitmapData = GlobalClass.getBitmapData(ImagesConst.LuckyBag_CardBack);
            this._itembg.bitmapData = GlobalClass.getBitmapData(ImagesConst.LuckyBag_YBbg);
            return;
        }

        public changeInfo(arg1: int): void
        {
            this.setData(arg1);
            return;
        }

        /* internal  */showCost(arg1: Boolean): void
        {
            this._itembg.visible = arg1;
            this._costTx.visible = arg1;
            this._goldBg1.visible = arg1;
            return;
        }

        /* internal */ /* var */_costTx: Object /* flash.text.TextField */;

        /* internal */ /* var */_bg: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_itembg: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_txBm: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_txBd: Object /* flash.display.BitmapData */;

        /* internal */ /* var */_goldBg1: Object /* flash.display.Bitmap */;
    }
